<?php
	/* Description: This file is used to display all category */
	#########IncludeFiles####################################################################################
	require_once '../inc/config.php';
	require_once "../inc/bootstrape.php";
	require_once _SITE_PATH_.'classes/Vendor/Vendor.php';
	require_once _SITE_PATH_.'classes/Master/Master.php';
	require_once _SITE_PATH_.'classes/CommonUtility/CommonUtility.php';

    $tableName = 'attribute_master';
    $colum = 'title';
    $moduleName = 'master';
    $manageScript = 'attribute_mng.php';
    $editScript = 'attribute_edit.php';
    $currentPage = 'attribute_mng.php';
    $_tplName = 'master/attribute_mng.tpl';
    $_title = 'Attribute Management';

	$action = trim($_REQUEST['action']);
	$id = trim($_REQUEST['id']);
	
	switch($action){
		case 'active':
			$parms['status'] = 1;
			$condition['id'] = $id;
			$row = CommonUtility::updateData($parms, $tableName, $condition);
			$errMsg = "101" ;
		break;
		case 'deactive':
			$parms['status'] = 0;
			$condition['id'] = $id;
			$row = CommonUtility::updateData($parms, $tableName, $condition);
			$errMsg = "102" ;
		break;
		case 'delete':
			$parms['status'] = 2;
			$condition['id'] = $id;
			$row = CommonUtility::updateData($parms, $tableName, $condition);
			$errMsg = "103" ;
		break;
	}
	
	if( $errMsg ){
		header("Location: $manageScript"."?msg=".$errMsg);
		exit;
	}

	$parms = array();
    $records = CommonUtility::getData($parms, $tableName);

	$errMsg = $_GET['msg'];	
	require_once _ADMIN_TPL_MAIN_;
?>
